using System;
using FluentNHibernate.Mapping;
using FluentNHibernate.Conventions;

namespace Caramel.NHibernate.Entities.Conventions
{
	public class ReferenceForeignKeyNamingConvention : IReferenceConvention
	{
		#region IConvention<IManyToOnePart> Members

		public bool Accept(IManyToOnePart target)
		{
			return true;
		}

		public void Apply(IManyToOnePart target)
		{
			target.ColumnName(target.Property.Name + "ID");
		}

		#endregion
	}
}
